#include <iostream>
#include <string>
#include <regex>
#include <fmt/format.h>
using namespace std;

int main()
{
    std::regex r1{ "02215" };
    std::cout << "Matching against: 02215\n"
              << fmt::format("02215: {}; 51220: {}\n\n", std::regex_match("02215", r1), std::regex_match("51220", r1));

    std::regex r2{ R"(\d{5})" };
    std::cout << R"(Matching against:\d{5})" << "\n"
              << fmt::format("02214: {}; 9874: {}\n", std::regex_match("02215", r2), std::regex_match("9874", r2));

    std::regex r3{ "[A-Z][a-z]*" };
    std::cout << R"(Matching against:[A-Z][a-z]*)" << "\n"
              << fmt::format("Wally: {}; eva:{}\n\n", std::regex_match("Wally", r3), std::regex_match("eva", r3));

    std::regex r4{ "[^a-z]" };
    std::cout << "Matching against:[^a-z]\n" << fmt::format("A: {}; a:{}\n\n", std::regex_match("A", r4), std::regex_match("a", r4));

    std::regex r5{ "[*+$]" };
    std::cout << "Matching against:[*+$]\n" << fmt::format("*: {}; !:{}\n\n", std::regex_match("*", r5), std::regex_match("!", r5));

    //at leaset one
    std::regex r6{ "[A-Z][a-z]+" };
    std::cout << "Matching against:[A-Z][a-z]+\n"
              << fmt::format("Wally: {}; E:{}\n\n", std::regex_match("Wally", r6), std::regex_match("E", r6));

    std::regex r7{ "labell?ed" };
    std::cout << "Matching against:labell?ed\n"
              << fmt::format("labelled: {},labeled: {},labellled: {}\n\n", std::regex_match("labelled", r7),
                             std::regex_match("labeled", r7), std::regex_match("labellled", r7));

    return 0;
}
